﻿using Financial.Data;
using Financial.Entity;
using Financial.Entity.Enums;
using System.Collections.Generic;
using System.Linq;

namespace Financial.Business
{
    public class IncomeBL
    {
        public static List<Income> GetPage(int pageIndex, int pageSize,
            out int totalCount, SortOrder sortOrder, IncomeType? incomeType)
        {
            IncomeDL incomeDL = new IncomeDL();
            return incomeDL.GetPage(pageIndex, pageSize, out totalCount, sortOrder, incomeType);
        }

        public static void CreateSaveToDatabase(Income income)
        {
            IncomeDL incomeDL = new IncomeDL();
            incomeDL.CreateSaveToDatabase(income);
        }

        public static void EditSaveToDatabase(Income income)
        {
            IncomeDL incomeDL = new IncomeDL();
            incomeDL.EditSaveToDatabase(income);
        }

        public static List<FamilyMember> AccessFamilyMembers()
        {
            IncomeDL incomeDL = new IncomeDL();
            return incomeDL.AccessFamilyMembers();
        }

        public static Income FindIncome(int id)
        {
            IncomeDL incomeDL = new IncomeDL();
            return incomeDL.FindIncome(id);
        }
    }
}
